package org.fuys.coder.infrastructure.repository;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.fuys.coder.domain.audit.respository.IAuditReviewRepository;
import org.fuys.coder.infrastructure.dao.AuditReviewMapper;
import org.fuys.coder.infrastructure.model.po.AuditReview;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @projectName: fuys-low-coder
 * @package: org.fuys.coder.infrastructure.repository
 * @className: AuditReviewRepositoryImpl
 * @author: WangJing
 * @description: 仓储实现
 * @date: 2024/6/30 22:38
 * @version: 1.0
 */

@Service
public class AuditReviewRepositoryImpl extends ServiceImpl<AuditReviewMapper, AuditReview>
        implements IAuditReviewRepository {

    @Resource
    private AuditReviewMapper auditReviewMapper;

    @Override
    public void saveRecord(Integer typeId, Long otherId,
                           Integer userId, String reason,Integer reviewer,Integer resultType) {
        AuditReview auditReview=new AuditReview();
        auditReview.setReviewReason(reason);
        auditReview.setBeAuditedId(otherId);
        auditReview.setReviewerId(reviewer);
        auditReview.setUserId(userId);
        auditReview.setReviewResult(resultType);
        auditReview.setTypeId(typeId);
        auditReviewMapper.insert(auditReview);
    }
}
